﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Abp.Domain.Repositories;
using Abp.ElasticSearch;
using AbpBuild;
using AbpBuild.LawManage;
using AbpBuild.WenShu;
using AbpBuild.WenShu.Dto;
using Newtonsoft.Json.Linq;

using System;
using DotnetSpider.Selector;
using System.Collections;
using Nest;
using System.Text.RegularExpressions;
using Abp.EntityFrameworkCore.Repositories;
using Microsoft.EntityFrameworkCore;
using Castle.DynamicProxy.Generators.Emitters.SimpleAST;
using Abp.Json;
using System.Runtime.CompilerServices;
using System.Security.Cryptography;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using Newtonsoft.Json;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Abp.Domain.Uow;
using System.Security.Policy;
using System.Web;
using Microsoft.AspNetCore.Mvc;
using System.Reflection;
using AbpBuild.BaseData;
using Castle.Core.Internal;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Xml.Serialization;
using Abp.Dependency;

namespace AbpBuild.WenShu
{
    public  class Helpers : AbpBuildAppServiceBase, IHelpers, ITransientDependency
    {
        #region 辅助

        public static string UrlEncode(string data)
        {
            if (data == null)
            {
                return "";
            }
            return System.Web.HttpUtility.UrlEncode(data, System.Text.Encoding.UTF8).Replace("%3A", ":").Replace("%2F", "/").Replace("+", "%20");
        }

        public  List<string> returnjudgeResuls(List<string> v, string con, List<string> yuangaos1, List<string> beigaos3)
        {
            List<string> dd = new List<string>();

            int yuan = 0;
            int bei = 0;
            foreach (var content in v)
            {
                bool yuangao = false;
                bool beigao = false;
                int yuangaoindex = 99999;
                int beigaoindex = 99999;
                bool yuangao1 = false;
                bool beigao1 = false;

                if (content.Contains("终结本次执行程序"))
                {
                    dd.Add("终结本次执行程序");
                }
                if (content.Contains("财产执行"))
                {
                    dd.Add("财产执行");
                }
                if (content.Contains("终结执行"))
                {
                    dd.Add("终结执行");
                }
                if (content.Contains("执行完毕"))
                {
                    dd.Add("执行完毕");
                }
                if (content.Contains("纳入失信"))
                {
                    dd.Add("纳入失信被执行人名单");
                }
                if (content.Contains("中止执行"))
                {
                    dd.Add("中止执行");
                }
                if (content.Contains("撤回申请"))
                {
                    dd.Add("撤回申请");
                }
                if (content.Contains("撤销申请"))
                {
                    dd.Add("撤销申请");
                }
                if ((content.Contains("指定") || content.Contains("提级")) && content.Contains("执行"))
                {
                    dd.Add("指定/提级执行");
                }
                if ((content.Contains("追加") || content.Contains("变更")) && content.Contains("执行人"))
                {
                    dd.Add("追加/变更执行人");
                }
                if (content.Contains("移送管辖"))
                {
                    dd.Add("移送管辖");
                }
                if (content.Contains("解除财产执行"))
                {
                    dd.Add("解除财产执行");
                }
                if (content.Contains("责令履行"))
                {
                    dd.Add("责令履行");
                }
                if (content.Contains("维持原判"))
                {
                    dd.Add("维持原判");
                }
                if (content.Contains("撤回起诉"))
                {
                    dd.Add("撤回起诉");
                }
                if (content.Contains("不予执行"))
                {
                    dd.Add("不予执行");
                }
                if (content.Contains("不予支持"))
                {
                    dd.Add("不予支持");
                }
                if (content.Contains("予以支持"))
                {
                    dd.Add("予以支持");
                }
                if (content.Contains("部分支持"))
                {
                    dd.Add("部分支持");
                }
                if (content.Contains("销案"))
                {
                    dd.Add("销案");
                }
                if (content.Contains("不予执行"))
                {
                    dd.Add("不予执行");
                }
                if (content.Contains("不予立案"))
                {
                    dd.Add("不予立案（原不予受理）");
                }
                if (content.Contains("不予登记立案"))
                {
                    dd.Add("不予登记立案");
                }
                if (content.Contains("裁定终结本次执行程序"))
                {
                    dd.Add("裁定终结本次执行程序");
                }
                if (content.Contains("保全完毕"))
                {
                    dd.Add("保全完毕");
                }
                if (content.Contains("部分保全"))
                {
                    dd.Add("部分保全");
                }
                if (content.Contains("无标的物可实施保全"))
                {
                    dd.Add("无标的物可实施保全");
                }
                if (content.Contains("解除保全"))
                {
                    dd.Add("解除保全");
                }
                if (content.Contains("部分撤回"))
                {
                    dd.Add("部分撤回");
                }
                if (content.Contains("准予撤回异议") || content.Contains("准予撤回申请"))
                {
                    dd.Add("准予撤回异议或申请");
                }
                if (content.Contains("驳回申请") || content.Contains("驳回异议"))
                {
                    dd.Add("驳回异议或申请");
                }
                if (content.Contains("撤销相关执行") || content.Contains("中止对执行标的的执行") || content.Contains("不予执行") || content.Contains("追加变更当事人"))
                {
                    dd.Add("异议成立并撤销相关执行行为、中止对执行标的的执行、不予执行、追加变更当事人");
                }
                if (content.Contains("部分撤销并变更执行行为") || content.Contains("部分不予执行") || content.Contains("部分追加变更当事人"))
                {
                    dd.Add("异议部分成立并部分撤销并变更执行行为、部分不予执行、部分追加变更当事人");
                }
                if ((content.Contains("异议成立") || content.Contains("部分成立")) && (content.Contains("不撤销执行行为") || content.Contains("不变更执行行为")))
                {
                    dd.Add("异议成立或部分成立但不撤销、变更执行行为");
                }
                if (content.Contains("终结审查")  )
                {
                    dd.Add("终结审查");
                }
                if (content.Contains("不予受理") )
                {
                    dd.Add("不予受理");
                }
                if (content.Contains("指令下一级法院立案")  )
                {
                    dd.Add("指令下一级法院立案");
                }
                if (content.Contains("指令下一级法院审查"))
                {
                    dd.Add("指令下一级法院审查");
                }
                if (content.Contains("裁定撤销执行案件"))
                {
                    dd.Add("裁定撤销执行案件");
                }
                
                if (content.Contains("撤销执行法院裁定并直接改正"))
                {
                    dd.Add("撤销执行法院裁定并直接改正");
                }
                if (content.Contains("责令执行法院限期改正"))
                {
                    dd.Add("责令执行法院限期改正");
                }
                if (content.Contains("驳回监督申请"))
                {
                    dd.Add("驳回监督申请");
                }
                if (content.Contains("准许撤回监督申请"))
                {
                    dd.Add("准许撤回监督申请");
                }
                if (content.Contains("督促按原处理意见办理"))
                {
                    dd.Add("督促按原处理意见办理");
                }
                if (content.Contains("纠正原处理意见"))
                {
                    dd.Add("纠正原处理意见");
                }
                if (content.Contains("准予撤回申请"))
                {
                    dd.Add("准予撤回申请");
                }
                if (content.Contains("裁定发回重新审查"))
                {
                    dd.Add("裁定发回重新审查");
                }
                if (content.Contains("撤销原裁定并裁定追加变更当事人"))
                {
                    dd.Add("撤销原裁定并裁定追加变更当事人");
                }
                if (content.Contains("撤销原裁定并裁定不予追加变更当事人"))
                {
                    dd.Add("撤销原裁定并裁定不予追加变更当事人");
                }
                if (content.Contains("撤销原裁定并裁定不予执行"))
                {
                    dd.Add("撤销原裁定并裁定不予执行");
                }
                if (content.Contains("撤销原裁定并裁定继续执行"))
                {
                    dd.Add("撤销原裁定并裁定继续执行");
                }
                if (content.Contains("撤销原裁定并撤销执行行为"))
                {
                    dd.Add("撤销原裁定并撤销执行行为");
                }
                if (content.Contains("撤销原裁定并裁定中止对执行标的的执行"))
                {
                    dd.Add("撤销原裁定并裁定中止对执行标的的执行");
                }
                if (content.Contains("变更原决定"))
                {
                    dd.Add("变更原决定");
                }
                if (content.Contains("撤销原决定"))
                {
                    dd.Add("撤销原决定");
                }
                if (content.Contains("变更原裁定"))
                {
                    dd.Add("变更原裁定");
                }
                //if (content.Contains("维持"))
                //{
                //    dd.Add("维持");
                //}
                if (content.Contains("本院提级执行"))
                {
                    dd.Add("本院提级执行");
                }
                if (content.Contains("指定其他法院执行"))
                {
                    dd.Add("指定其他法院执行");
                }
                if (content.Contains("对不予执行申请直接作出裁定"))
                {
                    dd.Add("对不予执行申请直接作出裁定");
                }
                if (content.Contains("指令重新审查"))
                {
                    dd.Add("指令重新审查");
                }
                if (content.Contains("撤回协调请求"))
                {
                    dd.Add("撤回协调请求");
                }
                if (content.Contains("协调解决"))
                {
                    dd.Add("协调解决（即达成一致意见）");
                }
                if (content.Contains("协调不成报请上级处理"))
                {
                    dd.Add("协调不成报请上级处理");
                }
                if (content.Contains("指定原执行法院管辖"))
                {
                    dd.Add("指定原执行法院管辖");
                }
                if (content.Contains("直接作出决定或裁定"))
                {
                    dd.Add("直接作出决定或裁定");
                }
                if (content.Contains("裁定本院提级执行"))
                {
                    dd.Add("裁定本院提级执行");
                }
                if (content.Contains("不同意报请法院处理意见"))
                {
                    dd.Add("不同意报请法院处理意见");
                }
                if (content.Contains("同意报请法院处理意见"))
                {
                    dd.Add("同意报请法院处理意见");
                }
                
                if (content.Contains("变更报请法院处理意见"))
                {
                    dd.Add("变更报请法院处理意见");
                }
                if (content.Contains("撤回请求"))
                {
                    dd.Add("撤回请求");
                }
                if (content.Contains("本院提级管辖"))
                {
                    dd.Add("本院提级管辖（含同意下级法院移送本院）");
                }
                if (content.Contains("本院不同意提级管辖"))
                {
                    dd.Add("本院不同意提级管辖（含不同意下级法院移送本院）");
                }
                if (content.Contains("本院指定其他法院管辖"))
                {
                    dd.Add("本院指定其他法院管辖");
                }
                if (content.Contains("本院指定报请法院管辖"))
                {
                    dd.Add("本院指定报请法院管辖");
                }
                if (content.Contains("商定由对方下级法院管辖"))
                {
                    dd.Add("商定由对方下级法院管辖");
                }
                if (content.Contains("终结"))
                {
                    dd.Add("终结");
                }
                if (content.Contains("按撤回上诉处理"))
                {
                    dd.Add("按撤回上诉处理");
                }
                if (content.Contains("撤销原裁定") && content.Contains("驳回管辖异议"))
                {
                    dd.Add("撤销原裁定并驳回管辖异议");
                }
                if (content.Contains("撤销原裁定") && content.Contains("移送其他法院管辖"))
                {
                    dd.Add("撤销原裁定并裁定移送其他法院管辖");
                }
                if (content.Contains("维持原裁定"))
                {
                    dd.Add("维持原裁定");
                }
                if (content.Contains("协商不成并报请最高院指定"))
                {
                    dd.Add("协商不成并报请最高院指定");
                }
                if (content.Contains("商定由本院下级法院管辖"))
                {
                    dd.Add("商定由本院下级法院管辖");
                }
                if (content.Contains("准予撤回上诉"))
                {
                    dd.Add("准予撤回上诉");
                }
                if (content.Contains("不予立案"))
                {
                    dd.Add("不予立案");
                }
                if (content.Contains("撤销原判") && content.Contains("驳回起诉"))
                {
                    dd.Add("撤销原判并驳回起诉");
                }
                if (content.Contains("发回重审"))
                {
                    dd.Add("发回重审");
                }
                if (content.Contains("改判"))
                {
                    dd.Add("改判");
                }
                if (content.Contains("指定其他下级法院立案审理"))
                {
                    dd.Add("指定其他下级法院立案审理");
                }
                if (content.Contains("并案审理"))
                {
                    dd.Add("与其他案件并案审理");
                }
                if (content.Contains("被指定其他法院管辖"))
                {
                    dd.Add("被指定其他法院管辖");
                }
                if (content.Contains("被上级法院提级管辖"))
                {
                    dd.Add("被上级法院提级管辖");
                }
                if (content.Contains("移送其他法院管辖"))
                {
                    dd.Add("裁定移送其他法院管辖");
                }
                //if (content.Contains("调解"))
                //{
                //    dd.Add("调解");
                //}
                if (content.Contains("按撤诉处理"))
                {
                    dd.Add("按撤诉处理");
                }
                if (content.Contains("准予撤诉"))
                {
                    dd.Add("准予撤诉");
                }
                if (content.Contains("驳回起诉"))
                {
                    dd.Add("驳回起诉");
                }
                if (content.Contains("撤销原裁定") && content.Contains("指令受理"))
                {
                    dd.Add("撤销原裁定并指令受理");
                }
                if (content.Contains("本院再审"))
                {
                    dd.Add("本院再审");
                }
                if (content.Contains("撤销原裁定") && content.Contains("指令审理"))
                {
                    dd.Add("撤销原裁定并指令审理");
                }
                if (content.Contains("撤销原判") && content.Contains("裁定移送其他法院管辖"))
                {
                    dd.Add("撤销原判并裁定移送其他法院管辖");
                }
                if (content.Contains("撤销原裁判并裁定移送"))
                {
                    dd.Add("撤销原裁判并裁定移送");
                }
                if (content.Contains("准予撤回抗诉"))
                {
                    dd.Add("准予撤回抗诉");
                }
                if (content.Contains("按撤回再审申请处理"))
                {
                    dd.Add("按撤回再审申请处理");
                }
                if (content.Contains("本院提审"))
                {
                    dd.Add("本院提审");
                }
                if (content.Contains("指令原审法院再审"))
                {
                    dd.Add("指令原审法院再审");
                }
                if (content.Contains("指定其他法院再审"))
                {
                    dd.Add("指定其他法院再审");
                }
                if (content.Contains("裁定驳回再审申请"))
                {
                    dd.Add("裁定驳回再审申请");
                }
                if (content.Contains("准予撤回再审申请"))
                {
                    dd.Add("准予撤回再审申请");
                }
                if (content.Contains("撤销原裁定并恢复二审程序"))
                {
                    dd.Add("撤销原裁定并恢复二审程序");
                }
                if (content.Contains("决定赔偿"))
                {
                    dd.Add("决定赔偿（含部分赔偿）");
                }
                if (content.Contains("不予赔偿"))
                {
                    dd.Add("决定不予赔偿");
                }
                if (content.Contains("不予立案"))
                {
                    dd.Add("不予立案（即不予受理）");
                }
                if (content.Contains("撤销原决定并决定赔偿"))
                {
                    dd.Add("撤销原决定并决定赔偿");
                }
                if (content.Contains("决定赔偿"))
                {
                    dd.Add("决定赔偿");
                }
                if (content.Contains("根据赔偿协议制作决定并撤销原决定"))
                {
                    dd.Add("根据赔偿协议制作决定并撤销原决定");
                }
                if (content.Contains("撤销原决定并驳回申请"))
                {
                    dd.Add("撤销原决定并驳回申请");
                }
                if (content.Contains("决定驳回申请"))
                {
                    dd.Add("决定驳回申请");
                }
                if (content.Contains("决定不予立案"))
                {
                    dd.Add("决定不予立案");
                }
                if (content.Contains("撤销原决定并指令复议机关作出决定"))
                {
                    dd.Add("撤销原决定并指令复议机关作出决定");
                }
                if (content.Contains("撤销原决定并指令赔偿义务法院作出决定"))
                {
                    dd.Add("撤销原决定并指令赔偿义务法院作出决定");
                }
                if (content.Contains("驳回申诉"))
                {
                    dd.Add("驳回申诉");
                }
                if (content.Contains("指令下级法院受理"))
                {
                    dd.Add("指令下级法院受理");
                }
                if (content.Contains("指令重新审理"))
                {
                    dd.Add("指令重新审理");
                }
                if (content.Contains("本院决定重新审理"))
                {
                    dd.Add("本院决定重新审理");
                }
                if (content.Contains("本院决定直接审理"))
                {
                    dd.Add("本院决定直接审理");
                }
                if (content.Contains("准许撤回申诉"))
                {
                    dd.Add("准许撤回申诉");
                }
                if (content.Contains("确认违法"))
                {
                    dd.Add("确认违法");
                }
                if (content.Contains("按撤回申诉处理"))
                {
                    dd.Add("按撤回申诉处理");
                }
                if (content.Contains("裁定准予强制执行"))
                {
                    dd.Add("裁定准予强制执行");
                }
                if (content.Contains("裁定不准予强制执行"))
                {
                    dd.Add("裁定不准予强制执行");
                }
                if (content.Contains("撤销原裁定并裁定不准予强制执行"))
                {
                    dd.Add("撤销原裁定并裁定不准予强制执行");
                }
                if (content.Contains("撤销原裁定并裁定准予强制执行"))
                {
                    dd.Add("撤销原裁定并裁定准予强制执行");
                }
                if (content.Contains("变更原裁定"))
                {
                    dd.Add("变更原裁定（即部分准予强制执行）");
                }
                if (content.Contains("发回重新审查"))
                {
                    dd.Add("发回重新审查");
                }
                if (content.Contains("准予撤回复议申请"))
                {
                    dd.Add("准予撤回复议申请");
                }
                if (content.Contains("按撤回复议申请处理"))
                {
                    dd.Add("按撤回复议申请处理");
                }
                if (content.Contains("批准下交审理"))
                {
                    dd.Add("批准下交审理");
                }
                if (content.Contains("不批准下交审理"))
                {
                    dd.Add("不批准下交审理");
                }
                if (content.Contains("裁定下级法院将案件移送有管辖权法院审理"))
                {
                    dd.Add("裁定下级法院将案件移送有管辖权法院审理");
                }
                if (content.Contains("撤销原判并裁定移送有管辖权法院审理"))
                {
                    dd.Add("撤销原判并裁定移送有管辖权法院审理");
                }
                if (content.Contains("决定不予再审"))
                {
                    dd.Add("决定不予再审");
                }
                if (content.Contains("撤销原生效判决") || content.Contains("撤销原生效裁定") || content.Contains("撤销原生效调解"))
                {
                    dd.Add("撤销原生效判决、裁定、调解");
                }
                if (content.Contains("仅撤销原生效判决的错误部分") || content.Contains("仅撤销原生效调解的错误部分") || content.Contains("仅撤销原生效裁定的错误部分"))
                {
                    dd.Add("仅撤销原生效判决、裁定、调解的错误部分");
                }
                if (content.Contains("仅变更原生效判决的错误部分") || content.Contains("仅变更原生效调解的错误部分") || content.Contains("仅变更原生效裁定的错误部分"))
                {
                    dd.Add("仅变更原生效判决、裁定、调解的错误部分");
                }
                if (content.Contains("驳回诉讼请求"))
                {
                    dd.Add("驳回诉讼请求");
                }
                if (content.Contains("并入再审案件审理"))
                {
                    dd.Add("并入再审案件审理");
                }
                if (content.Contains("判决变更选举委员会决定"))
                {
                    dd.Add("判决变更选举委员会决定");
                }
                if (content.Contains("终结程序"))
                {
                    dd.Add("终结程序");
                }
                if (content.Contains("宣告失踪"))
                {
                    dd.Add("判决宣告失踪");
                }
                if (content.Contains("宣告死亡"))
                {
                    dd.Add("判决宣告死亡");
                }
                if (content.Contains("撤销失踪宣告"))
                {
                    dd.Add("判决撤销失踪宣告");
                }
                if (content.Contains("撤销死亡宣告"))
                {
                    dd.Add("判决撤销死亡宣告");
                }
                if (content.Contains("撤销死亡宣告"))
                {
                    dd.Add("判决撤销死亡宣告");
                }
                if (content.Contains("驳回申请"))
                {
                    dd.Add("判决驳回申请");
                }
                if (content.Contains("裁定另行指定财产代管人"))
                {
                    dd.Add("裁定另行指定财产代管人");
                }
                if (content.Contains("裁定驳回申请"))
                {
                    dd.Add("裁定驳回申请");
                }
                if (content.Contains("认定无民事行为能力"))
                {
                    dd.Add("判决认定无民事行为能力");
                }
                if (content.Contains("认定限制民事行为能力"))
                {
                    dd.Add("判决认定限制民事行为能力");
                }
                if (content.Contains("撤销原判决并认定无民事行为能力"))
                {
                    dd.Add("撤销原判决并认定无民事行为能力");
                }
                if (content.Contains("撤销原判决并认定限制民事行为能力"))
                {
                    dd.Add("撤销原判决并认定限制民事行为能力");
                }
                if (content.Contains("撤销无民事行为能力认定"))
                {
                    dd.Add("撤销无民事行为能力认定");
                }
                if (content.Contains("撤销限制民事行为能力认定"))
                {
                    dd.Add("撤销限制民事行为能力认定");
                }
                if (content.Contains("裁定驳回异议"))
                {
                    dd.Add("裁定驳回异议");
                }
                if (content.Contains("撤销指定"))
                {
                    dd.Add("判决撤销指定");
                }
                if (content.Contains("准予撤回异议"))
                {
                    dd.Add("准予撤回异议");
                }
                if (content.Contains("按撤回异议处理"))
                {
                    dd.Add("按撤回异议处理");
                }
                if (content.Contains("变更监护关系"))
                {
                    dd.Add("判决变更监护关系");
                }
                if (content.Contains("收归国有"))
                {
                    dd.Add("判决收归国有");
                }
                if (content.Contains("收归集体所有"))
                {
                    dd.Add("判决收归集体所有");
                }
                if (content.Contains("撤销财产无主认定并判决财产归属"))
                {
                    dd.Add("撤销财产无主认定并判决财产归属");
                }
                if (content.Contains("裁定准予拍卖或变卖担保财产"))
                {
                    dd.Add("裁定准予拍卖或变卖担保财产");
                }
                if (content.Contains("确认协议有效"))
                {
                    dd.Add("确认协议有效");
                }
                if (content.Contains("裁定移送其他法院"))
                {
                    dd.Add("裁定移送其他法院");
                }
                if (content.Contains("设立海事赔偿责任限制基金"))
                {
                    dd.Add("设立海事赔偿责任限制基金");
                }
                if (content.Contains("受偿分配完毕"))
                {
                    dd.Add("受偿分配完毕");
                }
                if (content.Contains("终结债权登记与受偿程序"))
                {
                    dd.Add("终结债权登记与受偿程序");
                }
                if (content.Contains("撤销或部分撤销仲裁裁决"))
                {
                    dd.Add("撤销或部分撤销仲裁裁决");
                }
                if (content.Contains("认定仲裁协议有效"))
                {
                    dd.Add("认定仲裁协议有效");
                }
                if (content.Contains("认定仲裁协议无效"))
                {
                    dd.Add("认定仲裁协议无效");
                }
                if (content.Contains("驳回异议"))
                {
                    dd.Add("驳回异议");
                }
                if (content.Contains("作出新判决"))
                {
                    dd.Add("作出新判决");
                }
                if (content.Contains("撤销原裁判"))
                {
                    dd.Add("撤销原裁判");
                }
                if (content.Contains("变更原裁判"))
                {
                    dd.Add("变更原裁判");
                }
                if (content.Contains("不准予申请"))
                {
                    dd.Add("不准予申请");
                }
                if (content.Contains("作出除权判决"))
                {
                    dd.Add("作出除权判决");
                }
                if (content.Contains("终结催告程序"))
                {
                    dd.Add("终结催告程序");
                }
                if (content.Contains("支付令生效"))
                {
                    dd.Add("支付令生效");
                }
                if (content.Contains("撤销支付令"))
                {
                    dd.Add("撤销支付令");
                }
                if (content.Contains("驳回当事人请求"))
                {
                    dd.Add("驳回当事人请求");
                }
                if (content.Contains("终结强制清算程序"))
                {
                    dd.Add("终结强制清算程序");
                }
                if (content.Contains("终结破产程序"))
                {
                    dd.Add("终结破产程序");
                }
                if (content.Contains("作出人身安全保护令"))
                {
                    dd.Add("作出人身安全保护令");
                }
                if (content.Contains("驳回人身安全保护令申请"))
                {
                    dd.Add("驳回人身安全保护令申请");
                }
                if (content.Contains("撤销人身安全保护令"))
                {
                    dd.Add("撤销人身安全保护令");
                }
                if (content.Contains("变更人身安全保护令"))
                {
                    dd.Add("变更人身安全保护令");
                }
                if (content.Contains("延长人身安全保护令"))
                {
                    dd.Add("延长人身安全保护令");
                }
                if (content.Contains("指令其他法院再审"))
                {
                    dd.Add("指令其他法院再审");
                }
                if (content.Contains("终止"))
                {
                    dd.Add("终止");
                }
                if (content.Contains("准予撤回申诉"))
                {
                    dd.Add("准予撤回申诉");
                }
                if (content.Contains("通知不予重新审判"))
                {
                    dd.Add("通知不予重新审判");
                }
                if (content.Contains("层报上级法院审查"))
                {
                    dd.Add("层报上级法院审查");
                }
                if (content.Contains("退回检察院"))
                {
                    dd.Add("退回检察院");
                }
                if (content.Contains("裁定驳回全部申请"))
                {
                    dd.Add("裁定驳回全部申请");
                }
                if (content.Contains("裁定没收违法所得财产"))
                {
                    dd.Add("裁定没收违法所得财产（支持全部申请）");
                }
                if (content.Contains("裁定没收违法所得财产"))
                {
                    dd.Add("裁定没收违法所得财产（支持部分申请）");
                }
                if (content.Contains("终止审理"))
                {
                    dd.Add("终止审理");
                }
                if (content.Contains("裁定核准"))
                {
                    dd.Add("裁定核准");
                }
                if (content.Contains("改判"))
                {
                    dd.Add("改判（含部分核准）");
                }
                if (content.Contains("报请最高院核准"))
                {
                    dd.Add("报请最高院核准");
                }
                if (content.Contains("本院按二审程序提审"))
                {
                    dd.Add("本院按二审程序提审");
                }
                if (content.Contains("指定其他法院重审"))
                {
                    dd.Add("指定其他法院重审");
                }
                if (content.Contains("撤销原假释裁定"))
                {
                    dd.Add("撤销原假释裁定");
                }
                if (content.Contains("作出强制医疗决定"))
                {
                    dd.Add("作出强制医疗决定");
                }
                if (content.Contains("驳回强制医疗申请"))
                {
                    dd.Add("驳回强制医疗申请");
                }
                if (content.Contains("解除强制医疗决定"))
                {
                    dd.Add("解除强制医疗决定");
                }
                if (content.Contains("决定继续强制医疗"))
                {
                    dd.Add("决定继续强制医疗");
                }
                if (content.Contains("准予撤回监督意见"))
                {
                    dd.Add("准予撤回监督意见");
                }
                if (content.Contains("裁定停止执行死刑"))
                {
                    dd.Add("裁定停止执行死刑");
                }
                if (content.Contains("决定继续执行死刑"))
                {
                    dd.Add("决定继续执行死刑");
                }
                if (content.Contains("调查核实停止执行死刑事由存在"))
                {
                    dd.Add("调查核实停止执行死刑事由存在");
                }
                if (content.Contains("调查核实停止执行死刑事由不存在"))
                {
                    dd.Add("调查核实停止执行死刑事由不存在");
                }
                if (content.Contains("裁定继续执行死刑"))
                {
                    dd.Add("裁定继续执行死刑");
                }
                if (content.Contains("准许减免罚金"))
                {
                    dd.Add("准许减免罚金");
                }
                if (content.Contains("驳回减免罚金申请"))
                {
                    dd.Add("驳回减免罚金申请");
                }
                if (content.Contains("决定收监执行"))
                {
                    dd.Add("决定收监执行");
                }
                if (content.Contains("裁定减刑"))
                {
                    dd.Add("裁定减刑");
                }
                if (content.Contains("裁定不予减刑"))
                {
                    dd.Add("裁定不予减刑");
                }
                if (content.Contains("裁定假释"))
                {
                    dd.Add("裁定假释");
                }
                if (content.Contains("裁定不予假释"))
                {
                    dd.Add("裁定不予假释");
                }
                if (content.Contains("准予撤回减刑") && content.Contains("准予撤回假释"))
                {
                    dd.Add("准予撤回减刑、假释建议");
                }
                if (content.Contains("撤销缓刑"))
                {
                    dd.Add("撤销缓刑");
                }
                if (content.Contains("撤销假释"))
                {
                    dd.Add("撤销假释");
                }
                if (content.Contains("决定暂予监外执行"))
                {
                    dd.Add("决定暂予监外执行");
                }
                if (content.Contains("维持原裁定") || content.Contains("维持原决定"))
                {
                    dd.Add("维持原裁（决）定");
                }
                if (content.Contains("撤销原裁定") || content.Contains("撤销原决定"))
                {
                    dd.Add("撤销原裁（决）定");
                }
                if (content.Contains("变更原裁定") || content.Contains("变更原决定"))
                {
                    dd.Add("变更原裁（决）定");
                }
                if (content.Contains("检察院撤回监督意见"))
                {
                    dd.Add("检察院撤回监督意见");
                }
                if (content.Contains("指令原审法院重新审查"))
                {
                    dd.Add("指令原审法院重新审查");
                }
                if (content.Contains("予以备案"))
                {
                    dd.Add("予以备案");
                }
                if (content.Contains("同意并报请上级法院审查"))
                {
                    dd.Add("同意并报请上级法院审查");
                }
                if (content.Contains("责令依法纠正"))
                {
                    dd.Add("责令依法纠正");
                }
                if (content.IndexOf("如不服") >= 0)
                {
                    break;
                }
                foreach (var item in yuangaos1)
                {
                    if (content.IndexOf(item) < yuangaoindex && content.IndexOf(item) != -1)
                    {
                        yuangaoindex = content.IndexOf(item);
                        yuangao1 = true;
                    }
                }
                foreach (var item in beigaos3)
                {
                    if (content.IndexOf(item) < beigaoindex && content.IndexOf(item) != -1)
                    {
                        beigaoindex = content.IndexOf(item);
                        beigao1 = true;

                    }
                }

                if (yuangao1 || beigao1)
                {
                    if (yuangaoindex > beigaoindex)
                    {
                        beigao = true;
                    }
                    else
                    {
                        yuangao = true;
                    }

                    if (yuangao)
                    {
                        yuan += 1;

                    }
                    if (beigao)
                    {
                        bei += 1;

                    }
                }
                

                
                
            }

            if (yuan > 0 && bei == 0)
            {
                dd.Add("驳回申请");
            }
            if (yuan > 0 && bei > 0)
            {
                dd.Add("部分支持");
            }

            if (yuan == 0 && bei > 0)
            {
                dd.Add("全部支持");
            }




            if (dd.Count == 0)
            {
                dd.Add("其他");
            }

            return dd.Distinct<string>().ToList();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="hightlichar"></param>
        /// <param name="type">0关键字，1法律列表替换，2相关公司替换，3律师事务所替换，4律师替换，5案号替换，6公诉机关替换，7法官替换</param>
        public  void ReturnhightTags(Object obj, List<string> hightlichar)
        {
            try
            {
                string preTags0 = "<strong style=\"color: red;\">";
                string postTags0 = "</strong>";

                PropertyInfo[] propertys = obj.GetType().GetProperties();
                foreach (PropertyInfo pinfo in propertys)
                {
                    string name = pinfo.Name;
                    string types = pinfo.PropertyType.FullName;

                    if (types.Contains("lvmanage"))
                    {
                        foreach (string item in hightlichar)
                        {
                            List<lvmanage> values = (List<lvmanage>)pinfo.GetValue(obj, null);
                            if (values != null)
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    values[i].lvshi = values[i].lvshi.Replace(item.ToString(), preTags0 + item + postTags0);
                                    values[i].lvshishiwusuo = values[i].lvshishiwusuo.Replace(item.ToString(), preTags0 + item + postTags0);
                                }
                                pinfo.SetValue(obj, values);
                            }
                        }
                    }
                    else if (types.Contains("guanxiren"))
                    {
                        foreach (string item in hightlichar)
                        {
                            List<guanxiren> values = (List<guanxiren>)pinfo.GetValue(obj, null);
                            if (values != null)
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    values[i].gongsi = values[i].gongsi.Replace(item.ToString(), preTags0 + item + postTags0);
                                    for (int j = 0; j < values[i].dailiren.Count; j++)
                                    {
                                        values[i].dailiren[j] = values[i].dailiren[j].Replace(item.ToString(), preTags0 + item + postTags0);
                                    }
                                }
                                pinfo.SetValue(obj, values);
                            }
                        }
                    }
                    else if (types.Contains("relaLaw"))
                    {
                        foreach (string item in hightlichar)
                        {
                            List<relaLaw> values = (List<relaLaw>)pinfo.GetValue(obj, null);
                            if (values != null)
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    values[i].fgmc = values[i].fgmc.Replace(item.ToString(), preTags0 + item + postTags0);
                                    values[i].tkt = values[i].tkt.Replace(item.ToString(), preTags0 + item + postTags0);
                                }
                                pinfo.SetValue(obj, values);
                            }
                        }
                    }
                    else if (types.Contains("anyou"))
                    {
                        foreach (string item in hightlichar)
                        {
                            List<anyou> values = (List<anyou>)pinfo.GetValue(obj, null);
                            if (values != null)
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    values[i].text = values[i].text.Replace(item.ToString(), preTags0 + item + postTags0);
                                }
                                pinfo.SetValue(obj, values);
                            }
                        }
                    }
                    else if (types.Contains("List") && !types.Contains("Int32"))
                    {
                        foreach (string item in hightlichar)
                        {
                            List<string> values = (List<string>)pinfo.GetValue(obj, null);
                            if (values != null)
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    values[i] = values[i].Replace(item.ToString(), preTags0 + item + postTags0);
                                }
                                pinfo.SetValue(obj, values);
                            }

                        }
                    }
                    else if (types.Contains("String"))
                    {
                        foreach (string item in hightlichar)
                        {
                            if (pinfo.GetValue(obj, null) != null)
                            {
                                string value = pinfo.GetValue(obj, null).ToString().Replace(item.ToString(), preTags0 + item + postTags0);
                                pinfo.SetValue(obj, value);
                            }
                        }
                    }


                    //pinfo.PropertyType =
                    //pinfo.GetValue(obj, null)
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }

        public void ReturnDetailTagsALL(object obj, List<string> hightlichar)
        {
            try
            {
                string preTags0 = "<strong style=\"color: red;\">";
                string postTags0 = "</strong>";

                PropertyInfo[] propertys = obj.GetType().GetProperties();
                foreach (PropertyInfo pinfo in propertys)
                {
                    string name = pinfo.Name;
                    string types = pinfo.PropertyType.FullName;

                    if (types.Contains("String"))
                    {
                        foreach (string item in hightlichar)
                        {
                            string value = pinfo.GetValue(obj, null).ToString().Replace(item.ToString(), preTags0 + item + postTags0);
                            pinfo.SetValue(obj, value);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }

        public void ReturnDetailLaw(RecordDetailDTO obj)
        {
            try
            {
                PropertyInfo[] propertys = obj.GetType().GetProperties();
                foreach (PropertyInfo pinfo in propertys)
                {
                    string name = pinfo.Name;
                    string types = pinfo.PropertyType.FullName;

                    if (types.Contains("List") && !types.Contains("WenShu") && !types.Contains("Int32"))
                    {
                        List<string> values = (List<string>)pinfo.GetValue(obj, null);
                        if (values != null)
                        {
                            for (int i = 0; i < values.Count; i++)
                            {
                                values[i] = values[i].Substring(values[i].IndexOf('@') + 1, values[i].Length - values[i].IndexOf('@') - 1);
                                if (values[i].IndexOf("-A") > 0)
                                {
                                    values[i] = values[i].Substring(0, values[i].IndexOf("-A"));
                                }
                            }
                            pinfo.SetValue(obj, values);
                        }
                    }
                }
            }
            catch (Exception)
            {

                throw;
            }
        }

        public static T DeepCopyByXml<T>(T obj)
        {
            object retval;
            using (MemoryStream ms = new MemoryStream())
            {
                XmlSerializer xml = new XmlSerializer(typeof(T));
                xml.Serialize(ms, obj);
                ms.Seek(0, SeekOrigin.Begin);
                retval = xml.Deserialize(ms);
                ms.Close();
            }
            return (T)retval;
        }


        public  void ReturnDetailTags(RecordDetailDTO obj, List<string> hightlichar, int[] type = null)
        {
            try
            {
                RecordDetailDTO objtemp = DeepCopyByXml<RecordDetailDTO>(obj);

                List<string> peoples = objtemp.peoples;
                peoples.AddRange(objtemp.yuangao.Select(p => p.gongsi));
                foreach (var itemtt in objtemp.yuangao)
                {
                    peoples.AddRange(itemtt.dailiren);
                }
                peoples.AddRange(objtemp.beigao.Select(p => p.gongsi));
                foreach (var itemtt in objtemp.beigao)
                {
                    peoples.AddRange(itemtt.dailiren);

                }
                peoples.AddRange(objtemp.di3ren.Select(p => p.gongsi));
                foreach (var itemtt in objtemp.di3ren)
                {
                    peoples.AddRange(itemtt.dailiren);

                }



                peoples = peoples.Distinct().ToList();





                List<string> docCodeOthers = objtemp.docCodeOthers;

                if (type == null)
                {
                    type = new int[8] { 0, 1, 2, 3, 4, 5, 6, 7 };
                }
                List<lvmanage> lv = new List<lvmanage>();
                if (type != null && type.Contains(3))
                {
                    lv.AddRange(objtemp.yuangaoLv);
                    lv.AddRange(objtemp.beigaoLv);
                    lv.AddRange(objtemp.di3renLv);
                }
                List<string> jg = new List<string>();
                if (type != null && type.Contains(7))
                {
                    jg.AddRange(objtemp.judgeZ);
                    jg.AddRange(objtemp.judges);
                }
                
                string preTags0 = "<strong style=\"color: red;\">";
                string postTags0 = "</strong>";

                string preTags1 = "<a style=\"color: blue;\" class=\"lawsLists\" ";
                string postTagsa = "</a>";

                string preTags2 = "<a style=\"color: blue;\" class=\"companys\" ";

                string preTags21 = "<a style=\"color: blue;\" class=\"peoples\" ";

                string preTags3 = "<a style=\"color: blue;\" class=\"lawyercompanys\" ";

                string preTags4 = "<a style=\"color: blue;\" class=\"lawyers\" >";

                string preTags6 = "<a style=\"color: blue;\" class=\"gongsujiguan\" >";

                string preTags7 = "<a style=\"color: blue;\" class=\"judgers\" >";


                string preTags5 = "<a style=\"color: blue;\" class=\"docCode\" >";
                string preTags51 = "<a style=\"color: blue;\" class=\"judgeType\" >";
                string preTags52 = "<a style=\"color: blue;\" class=\"docType\" >";
                string preTags53 = "<a style=\"color: blue;\" class=\"courtFullName\" >";
                string preTags54 = "<a style=\"color: blue;\" class=\"region\" >";




                PropertyInfo[] propertys = obj.GetType().GetProperties();
                for (int p = 0; p < propertys.Length; p++)
                {
                    //PropertyInfo pinfo = propertys[p];
                    string name = propertys[p].Name;
                    string types = propertys[p].PropertyType.FullName;

                    if (types.Contains("lvmanage"))
                    {
                        if (type.Contains(3))
                        {
                            List<lvmanage> values = (List<lvmanage>)propertys[p].GetValue(obj, null);
                            foreach (var item in lv)
                            {
                                if (values != null)
                                {
                                    for (int i = 0; i < values.Count; i++)
                                    {
                                        if (!string.IsNullOrEmpty(item.lvshi))
                                        {
                                            if (!values[i].lvshi.Contains(preTags4 + item.lvshi + postTagsa))
                                            {
                                                values[i].lvshi = values[i].lvshi.Replace(item.lvshi.ToString(), preTags4 + item.lvshi + postTagsa);

                                            }
                                        }
                                        if (!string.IsNullOrEmpty(item.lvshishiwusuo))
                                        {
                                            if (!values[i].lvshishiwusuo.Contains(preTags3 + "onclick=\"openSearchCompany('" + item.lvshishiwusuo + "')\" >" + item.lvshishiwusuo + postTagsa))
                                            {
                                                values[i].lvshishiwusuo = values[i].lvshishiwusuo.Replace(item.lvshishiwusuo.ToString(), preTags3 + "onclick=\"openSearchCompany('" + item.lvshishiwusuo + "')\" >" + item.lvshishiwusuo + postTagsa);

                                            }

                                        }
                                    }
                                }
                            }
                                    propertys[p].SetValue(obj, values);
                        }
                        foreach (string item in hightlichar)
                        {
                            List<lvmanage> values = (List<lvmanage>)propertys[p].GetValue(obj, null);
                            if (values != null && !string.IsNullOrEmpty(item))
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    if (!values[i].lvshi.Contains(preTags0 + item + postTags0))
                                    {
                                        values[i].lvshi = values[i].lvshi.Replace(item.ToString(), preTags0 + item + postTags0);

                                    }
                                    if (!values[i].lvshishiwusuo.Contains( preTags0 + item + postTags0))
                                    {
                                        values[i].lvshishiwusuo = values[i].lvshishiwusuo.Replace(item.ToString(), preTags0 + item + postTags0);

                                    }
                                }
                                propertys[p].SetValue(obj, values);
                            }
                        }
                    }
                    else if (types.Contains("guanxiren"))
                    {
                       
                        if (type.Contains(2))
                        {
                            List<string> gg = peoples.Where(p => p.Length <= 5).ToList();
                            List<guanxiren> values = (List<guanxiren>)propertys[p].GetValue(obj, null);
                            foreach (string item in gg)
                            {
                                if (values != null && !string.IsNullOrEmpty(item))
                                {
                                    for (int i = 0; i < values.Count; i++)
                                    {
                                        if (values[i] != null && values[i].dailiren.Count > 0)
                                        {
                                            if (item.Length > 5)
                                            {
                                                if (!values[i].gongsi.Contains(preTags21 + "onclick=\"openSearchCompany('" + item + "')\" >" + item + postTagsa))
                                                {
                                                    values[i].gongsi = values[i].gongsi.Replace(item.ToString(), preTags21 + "onclick=\"openSearchCompany('" + item + "')\" >" + item + postTagsa);

                                                }

                                            }
                                            else
                                            {
                                                if (!values[i].gongsi.Contains(preTags21 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa))
                                                {
                                                    values[i].gongsi = values[i].gongsi.Replace(item.ToString(), preTags21 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa);

                                                }

                                            }
                                            for (int j = 0; j < values[i].dailiren.Count; j++)
                                            {
                                                if (!values[i].dailiren[j].Contains(preTags21 + "onclick=\"openSearchBoss('" + item + "')\" >" + item + postTagsa))
                                                {
                                                    values[i].dailiren[j] = values[i].dailiren[j].Replace(item.ToString(), preTags21 + "onclick=\"openSearchBoss('" + item + "')\" >" + item + postTagsa);

                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (!values[i].gongsi.Contains(preTags21 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa))
                                            {
                                                values[i].gongsi = values[i].gongsi.Replace(item.ToString(), preTags21 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa);

                                            }
                                        }

                                    }
                                }
                            }
                            List<string> gg1 = peoples.Where(p => p.Length > 5).ToList();
                            foreach (string item in gg1)
                            {
                                if (values != null && !string.IsNullOrEmpty(item))
                                {
                                    for (int i = 0; i < values.Count; i++)
                                    {
                                        if (values[i] != null && values[i].dailiren.Count > 0)
                                        {
                                            if (item.Length > 5)
                                            {
                                                if (!values[i].gongsi.Contains(preTags2 + "onclick=\"openSearchCompany('" + item + "')\" >" + item + postTagsa))
                                                {
                                                    values[i].gongsi = values[i].gongsi.Replace(item.ToString(), preTags2 + "onclick=\"openSearchCompany('" + item + "')\" >" + item + postTagsa);

                                                }
                                            }
                                            else
                                            {
                                                if (!values[i].gongsi.Contains(preTags2 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa))
                                                {
                                                    values[i].gongsi = values[i].gongsi.Replace(item.ToString(), preTags2 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa);

                                                }

                                            }
                                            for (int j = 0; j < values[i].dailiren.Count; j++)
                                            {
                                                if (!values[i].dailiren[j].Contains(preTags2 + "onclick=\"openSearchBoss('" + item + "')\" >" + item + postTagsa))
                                                {
                                                    values[i].dailiren[j] = values[i].dailiren[j].Replace(item.ToString(), preTags2 + "onclick=\"openSearchBoss('" + item + "')\" >" + item + postTagsa);

                                                }
                                            }
                                        }
                                        else
                                        {
                                            if (!values[i].gongsi.Contains(preTags2 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa))
                                            {
                                                values[i].gongsi = values[i].gongsi.Replace(item.ToString(), preTags2 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa);

                                            }
                                        }
                                        
                                    }
                                }
                            }
                            propertys[p].SetValue(obj, values);

                        }
                        foreach (string item in hightlichar)
                        {
                            List<guanxiren> values = (List<guanxiren>)propertys[p].GetValue(obj, null);
                            if (values != null && !string.IsNullOrEmpty(item))
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    if (!values[i].gongsi.Contains(preTags0 + item + postTags0))
                                    {
                                        values[i].gongsi = values[i].gongsi.Replace(item.ToString(), preTags0 + item + postTags0);

                                    }
                                    for (int j = 0; j < values[i].dailiren.Count; j++)
                                    {
                                        if (!values[i].dailiren[j].Contains(preTags0 + item + postTags0))
                                        {
                                            values[i].dailiren[j] = values[i].dailiren[j].Replace(item.ToString(), preTags0 + item + postTags0);

                                        }
                                    }
                                }
                                propertys[p].SetValue(obj, values);
                            }
                        }
                    }
                    else if (types.Contains("relaLaw"))
                    {
                        
                        if (type.Contains(1))
                        {
                            List<relaLaw> values = (List<relaLaw>)propertys[p].GetValue(obj, null);
                            if (values != null)
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    string fgmc = values[i].fgmc;
                                    string tkt = values[i].tkt;
                                    values[i].fgmc = preTags1 + "name=\""+ fgmc + "\" onclick=\"getLawDetail('"+ fgmc + "')\" >" + fgmc + postTagsa;
                                    values[i].tkt = " ---- " + preTags1 + "name=\"" + fgmc + "\"  tiao=\"" + tkt + "\" onclick=\"getLawDetail('" + fgmc + "', '"+ tkt + "')\" >" + tkt + postTagsa;
                                }
                                propertys[p].SetValue(obj, values);
                            }
                        }
                        foreach (string item in hightlichar)
                        {
                            List<relaLaw> values = (List<relaLaw>)propertys[p].GetValue(obj, null);
                            if (values != null && !string.IsNullOrEmpty(item))
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    values[i].fgmc = values[i].fgmc.Replace(item.ToString(), preTags0 + item + postTags0);
                                    values[i].tkt = values[i].tkt.Replace(item.ToString(), preTags0 + item + postTags0);
                                }
                                propertys[p].SetValue(obj, values);
                            }
                        }
                    }
                    else if (types.Contains("List") && !types.Contains("Int32") && !types.Contains("WenShu"))
                    {
                       
                        if (type.Contains(1))
                        {
                            List<string> values = (List<string>)propertys[p].GetValue(obj, null);
                            if (values != null)
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    values[i] = returnLawsTag(values[i], preTags1, postTagsa);
                                }
                                propertys[p].SetValue(obj, values);
                            }
                        }

                        if (type.Contains(2))
                        {
                            List<string> m5 = peoples.Where(p => p.Length > 5).ToList();
                            List<string> values = (List<string>)propertys[p].GetValue(obj, null);
                            foreach (string item in m5)
                            {
                                if (values != null && !string.IsNullOrEmpty(item))
                                {
                                    for (int i = 0; i < values.Count; i++)
                                    {
                                        if (item.Length > 5)
                                        {
                                            if (!values[i].Contains(preTags2 + "onclick=\"openSearchCompany('" + item + "')\" >" + item + postTagsa))
                                            {
                                                values[i] = values[i].Replace(item.ToString(), preTags2 + "onclick=\"openSearchCompany('" + item + "')\" >" + item + postTagsa);

                                            }
                                        }
                                        else
                                        {
                                            if (!values[i].Contains(preTags2 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa))
                                            {
                                                values[i] = values[i].Replace(item.ToString(), preTags2 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa);

                                            }
                                        }
                                    }
                                }
                            }
                            List<string> x5 = peoples.Where(p => p.Length <= 5).ToList();
                            foreach (string item in x5)
                            {
                                if (values != null && !string.IsNullOrEmpty(item))
                                {
                                    for (int i = 0; i < values.Count; i++)
                                    {
                                        if (item.Length > 5)
                                        {
                                            if (!values[i].Contains(preTags21 + "onclick=\"openSearchCompany('" + item + "')\" >" + item + postTagsa))
                                            {
                                                values[i] = values[i].Replace(item.ToString(), preTags21 + "onclick=\"openSearchCompany('" + item + "')\" >" + item + postTagsa);

                                            }
                                        }
                                        else
                                        {
                                            if (!values[i].Contains(preTags21 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa))
                                            {
                                                values[i] = values[i].Replace(item.ToString(), preTags21 + "onclick=\"openSearchFengXian('" + item + "')\" >" + item + postTagsa);

                                            }
                                        }
                                    }
                                }
                            }
                            propertys[p].SetValue(obj, values);
                        }
                        if (type.Contains(3))
                        {
                            List<string> values = (List<string>)propertys[p].GetValue(obj, null);
                            foreach (var item in lv)
                            {
                                if (values != null)
                                {
                                    for (int i = 0; i < values.Count; i++)
                                    {
                                        if (!string.IsNullOrEmpty(item.lvshi))
                                        {
                                            if (!values[i].Contains(preTags4 + item.lvshi + postTagsa))
                                            {
                                                values[i] = values[i].Replace(item.lvshi.ToString(), preTags4 + item.lvshi + postTagsa);

                                            }

                                        }
                                        if (!string.IsNullOrEmpty(item.lvshishiwusuo))
                                        {
                                            if (!values[i].Contains(preTags3 + "onclick=\"openSearchCompany('" + item.lvshishiwusuo + "')\" >" + item.lvshishiwusuo + postTagsa))
                                            {
                                                values[i] = values[i].Replace(item.lvshishiwusuo.ToString(), preTags3 + "onclick=\"openSearchCompany('" + item.lvshishiwusuo + "')\" >" + item.lvshishiwusuo + postTagsa);

                                            }
                                        }
                                    }
                                }
                            }
                                    propertys[p].SetValue(obj, values);
                        }
                        if (type.Contains(5))
                        {
                            List<string> values = (List<string>)propertys[p].GetValue(obj, null);

                            foreach (var item in docCodeOthers)
                            {
                                if (values != null && !string.IsNullOrEmpty(item))
                                {
                                    for (int i = 0; i < values.Count; i++)
                                    {
                                        if (!values[i].Contains(preTags5 + item + postTagsa))
                                        {
                                            values[i] = values[i].Replace(item, preTags5 + item + postTagsa);

                                        }
                                    }
                                }
                            }
                            propertys[p].SetValue(obj, values);
                        }
                        if (type.Contains(7))
                        {
                                List<string> values = (List<string>)propertys[p].GetValue(obj, null);
                            foreach (var item in jg)
                            {
                                if (values != null && !string.IsNullOrEmpty(item))
                                {
                                    for (int i = 0; i < values.Count; i++)
                                    {
                                        if (!values[i].Contains(preTags7 + item + postTagsa))
                                        {
                                            values[i] = values[i].Replace(item.ToString(), preTags7 + item + postTagsa);

                                        }
                                    }
                                }
                            }
                                    propertys[p].SetValue(obj, values);
                        }
                        foreach (string item in hightlichar)
                        {
                            List<string> values = (List<string>)propertys[p].GetValue(obj, null);
                            if (values != null && !string.IsNullOrEmpty(item))
                            {
                                for (int i = 0; i < values.Count; i++)
                                {
                                    if (!values[i].Contains(preTags0 + item + postTags0))
                                    {
                                        values[i] = values[i].Replace(item.ToString(), preTags0 + item + postTags0);

                                    }
                                }
                                propertys[p].SetValue(obj, values);
                            }
                        }

                    }
                    else if (types.Contains("String"))
                    {
                        
                        if (name == "docCode")
                        {
                            //string value = preTags5 + propertys[p].GetValue(obj, null).ToString() + postTagsa;
                            //propertys[p].SetValue(obj, value);
                        }
                        if (name == "judgeType")
                        {
                            string value = preTags51 + propertys[p].GetValue(obj, null).ToString() + postTagsa;
                            propertys[p].SetValue(obj, value);
                        }
                        if (name == "docType")
                        {
                            string value = preTags52 + propertys[p].GetValue(obj, null).ToString() + postTagsa;
                            propertys[p].SetValue(obj, value);
                        }
                        if (name == "courtFullName")
                        {
                            string value = preTags53 + propertys[p].GetValue(obj, null).ToString() + postTagsa;
                            propertys[p].SetValue(obj, value);
                        }
                        foreach (string item in hightlichar)
                        {
                            string value = propertys[p].GetValue(obj, null).ToString().Replace(item.ToString(), preTags0 + item + postTags0);
                            propertys[p].SetValue(obj, value);
                        }
                    }
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
        public  string returnLawsTag(string o, string preTags, string endTags)
        {
            string returnstr = string.Empty;
            MatchCollection mc = Regex.Matches(o, "《[^《]+第.{1,7}?条");  //有问题
            string[] strArray = new string[mc.Count];
            string[] strArrayed = new string[mc.Count];
            for (int i = 0; i < mc.Count; i++)
            {
                string temp = mc[i].Groups[0].Value;
                strArray[i] = temp;
                string fmc = temp.Substring(temp.IndexOf("《"), temp.IndexOf("》") + 1 - temp.IndexOf("《"));
                //[一|二|三|四|五|六|七|八|九|十|第]
                //MatchCollection mct = Regex.Matches(temp, "[一|二|三|四|五|六|七|八|九|十|第].{1,7}?条");  //有问题
                MatchCollection mct = Regex.Matches(temp, "第.{1,7}?条");  //有问题
                temp = temp.Replace(fmc, preTags + " name='" + fmc + "' onclick=\"getLawDetail('" + fmc + "')\"  >" + fmc + endTags);
                for (int j = 0; j < mct.Count; j++)
                {
                    temp = temp.Replace(mct[j].Groups[0].Value, " ---- " + preTags + "  name='"+ fmc + "' tiao='"+ mct[j].Groups[0].Value + "' onclick=\"getLawDetail('" + fmc + "', '" + mct[j].Groups[0].Value + "')\"  >" + mct[j].Groups[0].Value + endTags);
                }
                strArrayed[i] = temp;

            }
            if (strArrayed.Length > 0)
            {
                string[] c = o.Split(strArray, StringSplitOptions.None);
                for (int i = 0; i < c.Length; i++)
                {
                    if (i == c.Length - 1)
                    {
                        returnstr = returnstr + c[i];
                    }
                    else
                    {
                        returnstr = returnstr + c[i] + strArrayed[i];
                    }
                }
                return returnstr;
            }
            return o;
        }
        public  string returnLawT(string content)
        {
            if (!string.IsNullOrEmpty(content))
            {
                MatchCollection mc = Regex.Matches(content, "第.*?条");
                for (int i = 0; i < mc.Count; i++)
                {
                    return mc[i].Groups[0].Value.Replace(" ", "");
                }
            }
            return "";
        }

        public  string returnChina(string item1)
        {
            return Regex.Replace(item1, "[^\u4e00-\u9fa5]", "");
        }

        public  List<double> getListmoney(string o)
        {
            o = o.Replace(" ", "").Replace(",", "").Replace("，", "")
            .Replace("壹", "一").Replace("贰", "二").Replace("叁", "三").Replace("肆", "四")
            .Replace("伍", "五").Replace("陆", "六").Replace("柒", "七").Replace("捌", "八").Replace("玖", "九").Replace("拾", "十").Replace("佰", "百").Replace("仟", "千");

            List<double> mosos = new List<double>();
            MatchCollection mcmoney = Regex.Matches(o, "[\\d]+\\.?[\\d]+元");
            for (int i = 0; i < mcmoney.Count; i++)
            {
                double temp = getmoneydecimal(mcmoney[i].Groups[0].Value);
                if (!mosos.Contains(temp))
                {
                    mosos.Add(temp);
                }
            }
            MatchCollection mcmoneyw = Regex.Matches(o, "[\\d]+\\.?[\\d]{0,}万元");
            for (int i = 0; i < mcmoneyw.Count; i++)
            {
                double temp = getmoneydecimal(mcmoneyw[i].Groups[0].Value);
                if (!mosos.Contains(temp))
                {
                    mosos.Add(temp);
                }
            }
            MatchCollection mcmoneym = Regex.Matches(o, "[\\d]+\\.?[\\d]{0,}美元");
            for (int i = 0; i < mcmoneym.Count; i++)
            {
                double temp = getmoneydecimal(mcmoneym[i].Groups[0].Value);
                if (!mosos.Contains(temp))
                {
                    mosos.Add(temp);
                }
            }
            MatchCollection mcmoneywm = Regex.Matches(o, "[\\d]+\\.?[\\d]{0,}万[美]{0,1}元");
            for (int i = 0; i < mcmoneywm.Count; i++)
            {
                double temp = getmoneydecimal(mcmoneywm[i].Groups[0].Value);
                if (!mosos.Contains(temp))
                {
                    mosos.Add(temp);
                }
            }
            MatchCollection mcmoneydd = Regex.Matches(o.Replace(" ", ""), "[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]{0,}千{0,}[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]{0,}万{0,}[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]+百{0,}[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]{0,}万{0,}[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]{0,}元");
            for (int i = 0; i < mcmoneydd.Count; i++)
            {
                double temp = 0;
                if (mcmoneydd[i].Groups[0].Value.Contains("万"))
                {
                    temp += changeDxX(mcmoneydd[i].Groups[0].Value.Substring(0, mcmoneydd[i].Groups[0].Value.IndexOf("万"))) * 10000;
                }
                if (mcmoneydd[i].Groups[0].Value.Contains("亿"))
                {
                    temp += changeDxX(mcmoneydd[i].Groups[0].Value.Substring(0, mcmoneydd[i].Groups[0].Value.IndexOf("亿"))) * 100000000;
                }
                if (mcmoneydd[i].Groups[0].Value.Contains("万"))
                {
                    temp += changeDxX(mcmoneydd[i].Groups[0].Value.Substring(mcmoneydd[i].Groups[0].Value.IndexOf("万"), mcmoneydd[i].Groups[0].Value.Length - mcmoneydd[i].Groups[0].Value.IndexOf("万") - 1));
                }
                else
                {
                    temp += changeDxX(mcmoneydd[i].Groups[0].Value);

                }
                if (!mosos.Contains(temp))
                {
                    mosos.Add(temp);
                }
            }
            return mosos;
        }

        public  double getMaxmoney(string o)
        {
            o = o.Replace(" ", "").Replace(",", "").Replace("，", "")
            .Replace("壹", "一").Replace("贰", "二").Replace("叁", "三").Replace("肆", "四")
            .Replace("伍", "五").Replace("陆", "六").Replace("柒", "七").Replace("捌", "八").Replace("玖", "九").Replace("拾", "十").Replace("佰", "百").Replace("仟", "千");
            double maxmoney = 0;
            MatchCollection mcmoney = Regex.Matches(o, "[\\d]+\\.?[\\d]+元");
            for (int i = 0; i < mcmoney.Count; i++)
            {
                double temp = getmoneydecimal(mcmoney[i].Groups[0].Value);
                if (maxmoney < temp)
                {
                    maxmoney = temp;
                }
            }
            MatchCollection mcmoneyw = Regex.Matches(o, "[\\d]+\\.?[\\d]{0,}万元");
            for (int i = 0; i < mcmoneyw.Count; i++)
            {
                double temp = getmoneydecimal(mcmoneyw[i].Groups[0].Value);
                if (maxmoney < temp)
                {
                    maxmoney = temp;
                }
            }
            MatchCollection mcmoneym = Regex.Matches(o, "[\\d]+\\.?[\\d]{0,}美元");
            for (int i = 0; i < mcmoneym.Count; i++)
            {
                double temp = getmoneydecimal(mcmoneym[i].Groups[0].Value);
                if (maxmoney < temp)
                {
                    maxmoney = temp;
                }
            }
            MatchCollection mcmoneywm = Regex.Matches(o, "[\\d]+\\.?[\\d]{0,}万[美]{0,1}元");
            for (int i = 0; i < mcmoneywm.Count; i++)
            {
                double temp = getmoneydecimal(mcmoneywm[i].Groups[0].Value);
                if (maxmoney < temp)
                {
                    maxmoney = temp;
                }
            }
            MatchCollection mcmoneydd = Regex.Matches(o.Replace(" ", ""), "[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]{0,10}千{0,10}[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]{0,10}万{0,10}[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]+百{0,10}[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]{0,10}万{0,10}[一|二|三|四|五|六|七|八|九|十|零|0|1|2|3|4|5|6|7|8|9|\\s]{0,10}元");
            for (int i = 0; i < mcmoneydd.Count; i++)
            {
                double temp = 0;
                if (mcmoneydd[i].Groups[0].Value.Contains("万"))
                {
                    temp += changeDxX(mcmoneydd[i].Groups[0].Value.Substring(0, mcmoneydd[i].Groups[0].Value.IndexOf("万"))) * 10000;
                }
                if (mcmoneydd[i].Groups[0].Value.Contains("亿"))
                {
                    temp += changeDxX(mcmoneydd[i].Groups[0].Value.Substring(0, mcmoneydd[i].Groups[0].Value.IndexOf("亿"))) * 100000000;
                }
                if (mcmoneydd[i].Groups[0].Value.Contains("万"))
                {
                    temp += changeDxX(mcmoneydd[i].Groups[0].Value.Substring(mcmoneydd[i].Groups[0].Value.IndexOf("万"), mcmoneydd[i].Groups[0].Value.Length - mcmoneydd[i].Groups[0].Value.IndexOf("万") - 1));
                }
                else
                {
                    temp += changeDxX(mcmoneydd[i].Groups[0].Value);

                }

                if (maxmoney < temp)
                {
                    maxmoney = temp;
                }
            }
            return maxmoney;
        }
        public  int Compare(string s1, string s2, ref List<string> array)
        {
            try
            {

                if (s1.Length > 1 && s2.Length > 1)
                {
                    string temp1 = s1;//abc
                    string temp2 = s2;//xyzabc
                    string start1 = temp1.Substring(0, 1);//a
                    string start2 = temp2.Substring(0, 1);//x

                    int sint1 = temp2.IndexOf(start1) >= 0 ? temp2.IndexOf(start1) : 99999999;//4
                    int sint2 = temp1.IndexOf(start2) >= 0 ? temp1.IndexOf(start2) : 99999999;//99999

                    //if (sint1 == 99999 && sint2 == 99999)
                    //{
                    //    return Compare(temp1.Substring(1, temp1.Length - 1), temp2, ref array);
                    //}

                    if (sint1 > sint2)
                    {
                        temp1 = temp1.Substring(sint2, temp1.Length - sint2);
                    }
                    if (sint2 > sint1)
                    {
                        temp2 = temp2.Substring(sint1, temp2.Length - sint1);
                    }


                    int count = 0;/*相同字bai符个数*/
                    int n = temp1.Length > temp2.Length ? temp2.Length : temp1.Length;/*获得较短的字du符串的长度*/
                    for (int i = 0; i < n; i++)
                    {
                        if (temp1.Substring(i, 1) == temp2.Substring(i, 1) || temp1.Substring(i, 1)== "＊" || temp2.Substring(i, 1) == "＊")/*同位zhi置字符是否dao相同*/
                        {
                            count++;
                        }
                        else
                        {
                            array.Add(temp1.Substring(i, 1));
                            array.Add(temp2.Substring(i, 1));
                        }
                    }
                    return count;
                }
                return 0;
            }
            catch (Exception ex)
            {

                throw;
            }

        }
      
        public  List<string> IsContains(List<string> lists, string v)
        {
            List<string> ls = new List<string>();
            foreach (var item in lists)
            {
                if (v.Contains(item))
                {
                    ls.Add(item);
                }
            }
            return ls;
        }
        public  List<string> Ishave(List<string> lists, string[] v)
        {
            List<string> ls = new List<string>();
            foreach (var item in lists)
            {
                foreach (var item1 in v)
                {
                    if (item.Contains(item1))
                    {
                        ls.Add(item1);
                    }
                }
            }
            return ls;
        }
        


        public  List<int> getprisonterm(string v)
        {
            List<int> prisonterm = new List<int>();
            MatchCollection mcCodeOthers = Regex.Matches(v.Replace(" ", ""), "有期徒刑[一|二|三|四|五|六|七|八|九|十|0|1|2|3|4|5|6|7|8|9]{0,}年{0,}[一|二|三|四|五|六|七|八|九|十|0|1|2|3|4|5|6|7|8|9]{0,}个{0,}月{0,}");
            for (int i = 0; i < mcCodeOthers.Count; i++)
            {
                string temp = mcCodeOthers[i].Groups[0].Value.Replace("有期徒刑", "").Replace("个", "");
                int m = 0;
                int y = 0;
                if (temp.Contains("月") && temp.Contains("年"))
                {
                    string mm = temp.Substring(temp.IndexOf("年") + 1, temp.Length - temp.IndexOf("月"));
                    m = changeDxX(mm);
                }
                if (temp.Contains("月") && !temp.Contains("年"))
                {
                    string mm = temp.Substring(0, temp.IndexOf("月"));
                    m = changeDxX(mm);
                }
                if (temp.Contains("年"))
                {
                    string yy = temp.Substring(0, temp.IndexOf("年"));
                    y = changeDxX(yy);

                }

                if (!prisonterm.Contains(y * 12 + m))
                {
                    prisonterm.Add(y * 12 + m);
                }
            }
            if (v.Contains("无期徒刑"))
            {
                prisonterm.Add(100 * 12);
            }
            if (v.Contains("死刑"))
            {
                prisonterm.Add(1000 * 12);

            }

            return prisonterm;
        }

        public  int oneJten(string yy)
        {
            int y = 0;
            if (yy == "一")
            {
                y = 1;
            }
            if (yy == "二")
            {
                y = 2;
            }
            if (yy == "三")
            {
                y = 3;
            }
            if (yy == "四")
            {
                y = 4;
            }
            if (yy == "五")
            {
                y = 5;
            }
            if (yy == "六")
            {
                y = 6;
            }
            if (yy == "七")
            {
                y = 7;
            }
            if (yy == "八")
            {
                y = 8;
            }
            if (yy == "九")
            {
                y = 9;
            }
            return y;
        }
        public  int changeDxX(string yibaiyishiwu)
        {
            try
            {
                yibaiyishiwu = yibaiyishiwu.Replace("元", "");
                int ge = 0;
                int shi = 0;
                int bai = 0;
                int qian = 0;
                if (yibaiyishiwu.Contains("1") || yibaiyishiwu.Contains("2") || yibaiyishiwu.Contains("3") || yibaiyishiwu.Contains("4") || yibaiyishiwu.Contains("5") || yibaiyishiwu.Contains("6")
                     || yibaiyishiwu.Contains("7") || yibaiyishiwu.Contains("8") || yibaiyishiwu.Contains("9"))
                {
                    return Convert.ToInt32(yibaiyishiwu.Replace("万", "").Replace("千", "").Replace("百", "").Replace("十", "").Replace("零", ""));
                }
                if (yibaiyishiwu.Contains("零") && yibaiyishiwu.Length > 3)
                {
                    if (yibaiyishiwu.Substring(yibaiyishiwu.Length - 2, 1) == "零")
                    {
                        ge = oneJten(yibaiyishiwu.Substring(yibaiyishiwu.Length - 1, 1));
                    }
                }
                if (yibaiyishiwu.Contains("十"))
                {
                    if (yibaiyishiwu.Length == yibaiyishiwu.IndexOf("十") + 1)
                    {
                        ge = 0;
                    }
                    else
                    {
                        string temp = yibaiyishiwu.Substring(yibaiyishiwu.IndexOf("十") + 1, 1);
                        ge = oneJten(temp);
                    }
                    if (yibaiyishiwu.IndexOf("十") == 0)
                    {
                        shi = 10;
                    }
                    else
                    {
                        string temp = yibaiyishiwu.Substring(yibaiyishiwu.IndexOf("十") - 1, 1);
                        shi = oneJten(temp) * 10;
                    }

                }
                else
                {
                    ge = ge != 0 ? ge : oneJten(yibaiyishiwu);

                }
                if (yibaiyishiwu.Contains("百"))
                {
                    string temp = yibaiyishiwu.Substring(yibaiyishiwu.IndexOf("百") - 1, 1);
                    bai = oneJten(temp) * 100;
                }
                if (yibaiyishiwu.Contains("千"))
                {
                    string temp = yibaiyishiwu.Substring(yibaiyishiwu.IndexOf("千") - 1, 1);
                    qian = oneJten(temp) * 1000;
                }
                return ge + shi + bai + qian;
            }
            catch (Exception)
            {
                return 0;
            }

        }

        public  double getmoneydecimal(object o)
        {
            try
            {

                if (o == null)
                {
                    return 0;
                }
                else
                {
                    string temp = o.ToString();

                    if (temp.Contains("万美元"))
                    {
                        return Convert.ToDouble(temp.Replace("万美元", "")) * 69671;
                    }
                    else if (temp.Contains("万元"))
                    {
                        return Convert.ToDouble(temp.Replace("万元", "")) * 10000;
                    }
                    else if (temp.Contains("美元"))
                    {
                        return Convert.ToDouble(temp.Replace("美元", "")) * 6.9671;
                    }
                    else
                    {
                        return Convert.ToDouble(temp.Replace("元", ""));
                    }
                }
            }
            catch (Exception)
            {
                return 0;
            }
        }

        public  string replacekuo(string o)
        {
            MatchCollection mc3 = Regex.Matches(o, "（.*?）");
            for (int i = 0; i < mc3.Count; i++)
            {
                o = o.Replace(mc3[i].Groups[0].Value, "");
            }
            return o;
        }
        public  string GetStr(string o)
        {
            string a1 = "	";
            string b1 = "	";
            string c1 = "　";

            char A = (char)65313;
            char B = (char)65314;
            char C = (char)65315;
            char D = (char)65316;
            char E = (char)65317;
            char F = (char)65318;
            char G = (char)65319;
            char H = (char)65320;
            char I = (char)65321;
            char J = (char)65322;
            char K = (char)65323;
            char L = (char)65324;
            char M = (char)65325;
            char N = (char)65326;
            char O = (char)65327;
            char P = (char)65328;
            char Q = (char)65329;
            char R = (char)65330;
            char S = (char)65331;
            char T = (char)65332;
            char U = (char)65333;
            char V = (char)65334;
            char W = (char)65335;
            char X = (char)65336;
            char Y = (char)65337;
            char Z = (char)65338;

            char A1 = (char)65345;
            char B1 = (char)65346;
            char C1 = (char)65347;
            char D1 = (char)65348;
            char E1 = (char)65349;
            char F1 = (char)65350;
            char G1 = (char)65351;
            char H1 = (char)65352;
            char I1 = (char)65353;
            char J1 = (char)65354;
            char K1 = (char)65355;
            char L1 = (char)65356;
            char M1 = (char)65357;
            char N1 = (char)65358;
            char O1 = (char)65359;
            char P1 = (char)65360;
            char Q1 = (char)65361;
            char R1 = (char)65362;
            char S1 = (char)65363;
            char T1 = (char)65364;
            char U1 = (char)65365;
            char V1 = (char)65366;
            char W1 = (char)65367;
            char X1 = (char)65368;
            char Y1 = (char)65369;
            char Z1 = (char)65370;

            o = HttpUtility.HtmlDecode(o.Replace("；", ";").Replace("＆", "&").ToLower());

            return o.Replace("\n", "")
                    .Replace("/", "／")
                    .Replace(A, 'A')
                    .Replace(B, 'B')
                    .Replace(C, 'C')
                    .Replace(D, 'D')
                    .Replace(E, 'E')
                    .Replace(F, 'F')
                    .Replace(G, 'G')
                    .Replace(H, 'H')
                    .Replace(I, 'I')
                    .Replace(J, 'J')
                    .Replace(K, 'K')
                    .Replace(L, 'L')
                    .Replace(M, 'M')
                    .Replace(N, 'N')
                    .Replace(O, 'O')
                    .Replace(P, 'P')
                    .Replace(Q, 'Q')
                    .Replace(R, 'R')
                    .Replace(S, 'S')
                    .Replace(T, 'T')
                    .Replace(U, 'U')
                    .Replace(V, 'V')
                    .Replace(W, 'W')
                    .Replace(X, 'X')
                    .Replace(Y, 'Y')
                    .Replace(Z, 'Z')
                    .Replace(A1, 'A')
                    .Replace(B1, 'B')
                    .Replace(C1, 'C')
                    .Replace(D1, 'D')
                    .Replace(E1, 'E')
                    .Replace(F1, 'F')
                    .Replace(G1, 'G')
                    .Replace(H1, 'H')
                    .Replace(I1, 'I')
                    .Replace(J1, 'J')
                    .Replace(K1, 'K')
                    .Replace(L1, 'L')
                    .Replace(M1, 'M')
                    .Replace(N1, 'N')
                    .Replace(O1, 'O')
                    .Replace(P1, 'P')
                    .Replace(Q1, 'Q')
                    .Replace(R1, 'R')
                    .Replace(S1, 'S')
                    .Replace(T1, 'T')
                    .Replace(U1, 'U')
                    .Replace(V1, 'V')
                    .Replace(W1, 'W')
                    .Replace(X1, 'X')
                    .Replace(Y1, 'Y')
                    .Replace(Z1, 'Z')
                    .Replace("\"", "“")
                    .Replace("+", "＋")
                    .Replace("'", "‘")
                    .Replace(":", "：")
                    .Replace(";", "；")
                    .Replace(",", "，")
                    .Replace(".", "。")
                    .Replace("?", "？")
                    .Replace("<", "＜")
                    .Replace(">", "＞")
                    .Replace("(", "（")
                    .Replace(")", "）")
                    .Replace("@", "＠")
                    .Replace("=", "＝")
                    .Replace("+", "＋")
                    .Replace("*", "＊")
                    .Replace("&", "＆")
                    .Replace("#", "＃")
                    .Replace("%", "％")
                    .Replace("$", "￥")
                    .Replace(" ", "").Replace(a1, "").Replace(b1, "").Replace(c1, "")
                    .Replace("━", "-").ToUpper()
.Replace("┃", "|")
.Replace("▎", "|")
.Replace("▏", "|")
.Replace("✛", "+")
.Replace("✜", "+")
.Replace("○", "O")
.Replace("ℂ", "C")
.Replace("ℍ", "H")
.Replace("ℕ", "N")
.Replace("ℙ", "P")
.Replace("ℚ", "Q")
.Replace("ℝ", "R")
.Replace("ℤ", "Z")
.Replace("ℬ", "B")
.Replace("ℱ", "F")
.Replace("ℊ", "G")
.Replace("ℋ", "H")
.Replace("ℎ", "H")
.Replace("ℐ", "G")
.Replace("ℳ", "M")
.Replace("ℴ", "O")
.Replace("ℛ", "R")
.Replace("℮", "E")
.Replace("♮", "#")
.Replace("♯", "#")
.Replace("➀", "1")
.Replace("➁", "2")
.Replace("➂", "3")
.Replace("➃", "4")
.Replace("➄", "5")
.Replace("➅", "6")
.Replace("➆", "7")
.Replace("➇", "8")
.Replace("➈", "9")
.Replace("➉", "10")
.Replace("ⅼ", "L")
.Replace("ⅽ", "C")
.Replace("ⅾ", "D")
.Replace("ⅿ", "M")
.Replace("㋀", "1月")
.Replace("㋁", "2月")
.Replace("㋂", "3月")
.Replace("㋃", "4月")
.Replace("㋄", "5月")
.Replace("㋅", "6月")
.Replace("㋆", "7月")
.Replace("㋇", "8月")
.Replace("㋈", "9月")
.Replace("㋉", "10月")
.Replace("㋊", "11月")
.Replace("㋋", "12月")
.Replace("㏠", "1日")
.Replace("㏡", "2日")
.Replace("㏢", "3日")
.Replace("㏣", "4日")
.Replace("㏤", "5日")
.Replace("㏥", "6日")
.Replace("㏦", "7日")
.Replace("㏧", "8日")
.Replace("㏨", "9日")
.Replace("㏩", "10日")
.Replace("㏪", "11日")
.Replace("㏫", "12日")
.Replace("㏬", "13日")
.Replace("㏭", "14日")
.Replace("㏮", "15日")
.Replace("㏯", "16日")
.Replace("㏰", "17日")
.Replace("㏱", "18日")
.Replace("㏲", "19日")
.Replace("㏳", "20日")
.Replace("㏴", "21日")
.Replace("㏵", "22日")
.Replace("㏶", "23日")
.Replace("㏷", "24日")
.Replace("㏸", "25日")
.Replace("㏹", "26日")
.Replace("㏺", "27日")
.Replace("㏻", "28日")
.Replace("㏼", "29日")
.Replace("㏽", "30日")
.Replace("㏾", "31日")
.Replace("㍙", "1点")
.Replace("㍚", "2点")
.Replace("㍛", "3点")
.Replace("㍜", "4点")
.Replace("㍝", "5点")
.Replace("㍞", "6点")
.Replace("㍟", "7点")
.Replace("㍠", "8点")
.Replace("㍡", "9点")
.Replace("㍢", "10点")
.Replace("㍣", "11点")
.Replace("㍤", "12点")
.Replace("㍥", "13点")
.Replace("㍦", "14点")
.Replace("㍧", "15点")
.Replace("㍨", "16点")
.Replace("㍩", "17点")
.Replace("㍪", "18点")
.Replace("㍫", "19点")
.Replace("㍬", "20点")
.Replace("㍭", "21点")
.Replace("㍮", "22点")
.Replace("㍯", "23点")
.Replace("㍰", "24点")
.Replace("㍘", "0点")
.Replace("②", "2")
.Replace("③", "3")
.Replace("④", "4")
.Replace("⑤", "5")
.Replace("⑥", "6")
.Replace("⑦", "7")
.Replace("⑧", "8")
.Replace("⑨", "9")
.Replace("⑩", "10")
.Replace("⑪", "11")
.Replace("⑫", "12")
.Replace("⑬", "13")
.Replace("⑭", "14")
.Replace("⑮", "15")
.Replace("⑯", "16")
.Replace("⑰", "17")
.Replace("⑱", "18")
.Replace("⑲", "19")
.Replace("⑳", "20")
.Replace("⓪", "0")
.Replace("❶", "1")
.Replace("❷", "2")
.Replace("❸", "3")
.Replace("❹", "4")
.Replace("❺", "5")
.Replace("❻", "6")
.Replace("❼", "7")
.Replace("❽", "8")
.Replace("❾", "9")
.Replace("❿", "10")
.Replace("⓫", "11")
.Replace("⓬", "12")
.Replace("⓭", "13")
.Replace("⓮", "14")
.Replace("⓯", "15")
.Replace("⓰", "16")
.Replace("⓱", "17")
.Replace("⓲", "18")
.Replace("⓳", "19")
.Replace("⓴", "20")
.Replace("㊀", "一")
.Replace("㊁", "二")
.Replace("㊂", "三")
.Replace("㊃", "四")
.Replace("㊄", "五")
.Replace("㊅", "六")
.Replace("㊆", "七")
.Replace("㊇", "八")
.Replace("㊈", "九")
.Replace("㊉", "十")
.Replace("㈠", "一")
.Replace("㈡", "二")
.Replace("㈢", "三")
.Replace("㈣", "四")
.Replace("㈤", "五")
.Replace("㈥", "六")
.Replace("㈦", "七")
.Replace("㈧", "八")
.Replace("㈨", "九")
.Replace("㈩", "十")
.Replace("⑴", "1")
.Replace("⑵", "2")
.Replace("⑶", "3")
.Replace("⑷", "4")
.Replace("⑸", "5")
.Replace("⑹", "6")
.Replace("⑺", "7")
.Replace("⑻", "8")
.Replace("⑼", "9")
.Replace("⑽", "10")
.Replace("⑾", "11")
.Replace("⑿", "12")
.Replace("⒀", "13")
.Replace("⒁", "14")
.Replace("⒂", "15")
.Replace("⒃", "16")
.Replace("⒄", "17")
.Replace("⒅", "18")
.Replace("⒆", "19")
.Replace("⒇", "20")
.Replace("⒈", "1。")
.Replace("⒉", "2。")
.Replace("⒊", "3。")
.Replace("⒋", "4。")
.Replace("⒌", "5。")
.Replace("⒍", "6。")
.Replace("⒎", "7。")
.Replace("⒏", "8。")
.Replace("⒐", "9。")
.Replace("⒑", "10。")
.Replace("⒒", "11。")
.Replace("⒓", "12。")
.Replace("⒔", "13。")
.Replace("⒕", "14。")
.Replace("⒖", "15。")
.Replace("⒗", "16。")
.Replace("⒘", "17。")
.Replace("⒙", "18。")
.Replace("⒚", "19。")
.Replace("⒛", "20。")
.Replace("Ⅺ", "6")
.Replace("Ⅻ", "7")
.Replace("ⅰ", "1")
.Replace("ⅱ", "2")
.Replace("ⅲ", "3")
.Replace("ⅳ", "4")
.Replace("ⅴ", "5")
.Replace("ⅵ", "6")
.Replace("ⅶ", "7")
.Replace("ⅷ", "8")
.Replace("ⅸ", "9")
.Replace("ⅹ", "10")
.Replace("ⓐ", "A")
.Replace("ⓑ", "B")
.Replace("ⓒ", "C")
.Replace("ⓓ", "D")
.Replace("ⓕ", "F")
.Replace("ⓖ", "G")
.Replace("ⓗ", "H")
.Replace("ⓘ", "I")
.Replace("ⓙ", "J")
.Replace("ⓚ", "K")
.Replace("ⓜ", "M")
.Replace("ⓝ", "N")
.Replace("ⓟ", "P")
.Replace("ⓠ", "Q")
.Replace("ⓡ", "R")
.Replace("ⓢ", "S")
.Replace("ⓣ", "T")
.Replace("ⓤ", "U")
.Replace("ⓦ", "W")
.Replace("ⓧ", "X")
.Replace("ⓨ", "Y")
.Replace("ⓩ", "Z")
.Replace("⒜", "A")
.Replace("⒝", "B")
.Replace("⒞", "C")
.Replace("⒟", "D")
.Replace("⒠", "E")
.Replace("⒡", "F")
.Replace("⒢", "G")
.Replace("⒣", "H")
.Replace("⒤", "I")
.Replace("⒥", "J")
.Replace("⒦", "K")
.Replace("⒧", "L")
.Replace("⒨", "M")
.Replace("⒩", "N")
.Replace("⒪", "O")
.Replace("⒫", "P")
.Replace("⒬", "Q")
.Replace("⒭", "R")
.Replace("⒮", "S")
.Replace("⒯", "T")
.Replace("⒰", "U")
.Replace("⒱", "V")
.Replace("⒲", "W")
.Replace("⒳", "X")
.Replace("⒴", "Y")
.Replace("⒵", "Z")
.Replace("≠", "!=")
.Replace("≤", "<=")
.Replace("≥", ">=")
.Replace("≦", "<=")
.Replace("≧", ">=")
.Replace("∶", "：")
.Replace("〝", "“")
.Replace("〞", "”")
.Replace("﹕", "：")
.Replace("︰", "：")
.Replace("﹔", "；")
.Replace("﹖", "？")
.Replace("﹑", "、")
.Replace("•", "。")
.Replace("¸", ",")
.Replace("～", "~")
.Replace("ˉ", "-")
.Replace("｜", "|")
.Replace("‖", "||")
.Replace("＂", "“")
.Replace("〃", "”")
.Replace("｀", "‘")
.Replace("﹟", "#")
.Replace("﹠", "&")
.Replace("﹪", "%")
.Replace("﹡", "*")
.Replace("‐", "-")
.Replace("￣", "-")
.Replace("¯", "-")
.Replace("―", "—")
.Replace("﹨", "\\")
.Replace("＿", "_")
.Replace("〈", "＜")
.Replace("〉", "＞")
.Replace("‹", "＜")
.Replace("›", "＞")
.Replace("﹛", "{")
.Replace("﹜", "}")
.Replace("〖", "【")
.Replace("〗", "】")
.Replace("［", "[")
.Replace("］", "]")
.Replace("〔", "（")
.Replace("〕", "）")
.Replace("「", "[")
.Replace("」", "]")
.Replace("❝", "“")
.Replace("❞", "”")
.Replace("°", "。")
.Replace("′", "’")
.Replace("″", "“")
.Replace("＄", "$")
.Replace("％", "%")
.Replace("＠", "@")
.Replace("﹩", "$")
.Replace("﹫", "@")
.Replace("㎎", "mg")
.Replace("㎏", "kg")
.Replace("㏄", "cc")
.Replace("×", "X")
.Replace("✙", "+")
.Replace("〓", "=")
.Replace("✚", "+")
.Replace("ⓛ", "L")
.Replace("ⓞ", "O")
.Replace("ⓥ", "V")
.Replace("ⓔ", "E")
.Replace("╬", "+")
.Replace("『", "[")
.Replace("』", "]")
.Replace("①", "1")
.Replace("⊕", "+")
.Replace("✕", "X")
.Replace("✖", "X")
.Replace("♭", "B")
.Replace("Α", "A")
.Replace("Β", "B")
.Replace("Ε", "E")
.Replace("Ζ", "Z")
.Replace("Η", "H")
.Replace("Θ", "O")
.Replace("Ι", "I")
.Replace("Κ", "K")
.Replace("Λ", "A")
.Replace("Μ", "M")
.Replace("Ν", "N")
.Replace("Ο", "O")
.Replace("Ρ", "P")
.Replace("Τ", "T")
.Replace("Υ", "R")
.Replace("Φ", "O")
.Replace("Χ", "X")
;
        }
        public  long[] fetchNumber(string s)
        {
            List<long> longNumbers = new List<long>();
            char[] chs = s.ToCharArray();
            long number = -1;
            bool isNumber = false;
            for (int i = 0; i < chs.Length; i++)
            {
                if (chs[i] >= 48 && chs[i] <= 57)
                {
                    if (number < 0)
                    {
                        number = 0;
                    }
                    number = number * 10 + chs[i] - 0x30;
                    isNumber = true;
                }
                else
                {
                    if (number >= 0 && isNumber)
                    {
                        longNumbers.Add(number);
                        number = -1;
                        isNumber = false;
                    }
                }
            }
            if (number >= 0)
            {
                longNumbers.Add(number);
            }
            return longNumbers.ToArray();
        }


        #endregion
    }
}
